package com.leen.news.controller;


import com.alibaba.fastjson.JSONObject;
import com.leen.common.vo.ResultEnum;
import com.leen.common.vo.ResultVO;
import com.leen.exam.entity.News;
import com.leen.security.CurrentAdminInfo;
import com.leen.security.domain.AdminLoginUserDetails;
import com.netflix.hystrix.contrib.javanica.annotation.DefaultProperties;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand;
import com.netflix.hystrix.contrib.javanica.annotation.HystrixProperty;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.core.Authentication;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import java.util.HashMap;
import java.util.Map;


@Log4j2
@RestController
@RequestMapping(value ="/news")
public class NewsController {


    @GetMapping(value = "/data")
    public ResultVO data() {
       try{

           return ResultVO.success(CurrentAdminInfo.getAdminLoginUserDetails());
       }catch (Exception e){
          log.debug(e);
          return ResultVO.failed(ResultEnum.SYSTEM_ERROR);
       }

    }

}
